package utils;

import java.util.concurrent.TimeUnit;

// 引用方法直接使用： import static utils.Sleeper.sleep;
public class Sleeper {

    public static void sleep(int seconds) {
        try {
            TimeUnit.SECONDS.sleep(seconds);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public static void sleep(double seconds) {
        try {
            TimeUnit.MILLISECONDS.sleep((int) (seconds * 1000));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }


}
